package com.sjm.bookshop.dao;

import com.sjm.bookshop.entity.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface ClientDao {

     List<BookS> getBooks(@Param("recommend")int recommend,@Param("bookstatus") int bookstatus);

    //图书
    List<BookS> bookList(@Param("bookstatus")int bookstatus);

    BookS getById(@Param("bookId") int bookId, @Param("bookstatus") int bookstatus);

    List<BookS> getRelative(@Param("type") int type,@Param("bookstatus") int bookstatus);

    List<BookS> getRecommend();

    List<BookS> getMoreList();

    List<Address> getUserAddressById(Integer id);

    int deleteAddress(@Param("id") int id);

    int updateIsDefault(@Param("i") int i);

    int updateAddress(Address address);

    int addOneAddress(Address address);

    int addOrder(Orders order);

    int addOrderBacth(@Param("list") List<OrderDetail> list);


    int matchByBookId(@Param("integerMap") Map<Integer, Integer> integerMap);

    int addOneOrder(OrderDetail orderDetail);

    List<Book> getBookBySearch(@Param("keyword") String keyword);
}
